<?php
/**
 * StreamController
 *
 * PHP Version 5.4
 *
 * @author liuxuTJ <liuxuphp@icesmart.cn>
 */
namespace Admin\Controller;
use Admin\Service\PermissionService;
use Admin\Service\UserService;
use Api\Controller\ServiceController;
use Think\Controller;

/**
 * Class StreamController
 */
class StreamController extends BaseController {

    public function __construct()
    {
        parent::__construct();
        $userService = new UserService();
        $userInfo = $userService->validateLogin();   //验证是否登录

        $permissionService = new PermissionService();

        $menu = $permissionService->menu($userInfo['userId']);

        $this->assign('menu', $menu);
        $this->assign('userInfo', $userInfo);
    }


    /**
     * 服务器流通道 查询
     */
    public function index()
    {
        $serviceApi = new ServiceController();
        $streamList = $serviceApi->findStreams();

        $this->assign('url', '/Stream/index');
        $this->assign('streamList', $streamList);
        $this->display();
    }

}